home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / SRC1229A.ARJ / ARCDUMP.C < prev    next >
C/C++ Source or Header  |  1991-01-27  |  776b  |  46 lines

  1. /* ARCNET trace routines
  2.  * Copyright 1990 Russ Nelson
  3.  */
  4.  
  5. #include <stdio.h>
  6. #include "global.h"
  7. #include "mbuf.h"
  8. #include "arcnet.h"
  9. #include "trace.h"
  10.  
  11. void
  12. arc_dump(fp,bpp,check)
  13. FILE *fp;
  14. struct mbuf **bpp;
  15. int check;    /* Not used */
  16. {
  17.     struct arc ahdr;
  18.     char s[20],d[20];
  19.  
  20.     ntoharc(&ahdr,bpp);
  21.     parc(s,ahdr.source);
  22.     parc(d,ahdr.dest);
  23.     fprintf(fp,"Arcnet: len %u %s->%s",ARCLEN + len_p(*bpp),s,d);
  24.  
  25.     switch(uchar(ahdr.type)){
  26.         case ARC_IP:
  27.             fprintf(fp," type IP\n");
  28.             ip_dump(fp,bpp,1);
  29.             break;
  30.         case ARC_ARP:
  31.             fprintf(fp," type ARP\n");
  32.             arp_dump(fp,bpp);
  33.             break;
  34.         default:
  35.             fprintf(fp," type 0x%x\n",ahdr.type);
  36.             break;
  37.     }
  38. }
  39. int
  40. arc_forus(iface,bp)
  41. struct iface *iface;
  42. struct mbuf *bp;
  43. {
  44.     return 1;
  45. }
  46.